package com.nowcoder.code.lcof;

import com.algorithm.model.ListNode;

public class JZ24 {
    public static void main(String[] args) {

    }

    public ListNode ReverseList(ListNode head) {
        ListNode last = null;
        ListNode now = null;

        while (head != null) {
            now = head;
            head = head.next;
            now.next = last;
            last = now;
        }
        return now;

    }
}
